import {defineConfig} from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import path from 'path';

const resolve = (filePath: string) => path.resolve(__dirname, './', filePath);

// https://vitejs.dev/config/
export default defineConfig({
  base: '/vue-x6-editor/',
  resolve: {
    alias: {
      '@antv/x6': resolve('build/vue3/antvx6.js'),
    }
  },
  build: {
    outDir: 'docs',
    rollupOptions: {
      input: {
        main: resolve('index.html'),
      }
    },
  },
  plugins: [vue({}), vueJsx({})],
});
